// props.children

import React from "react";
import ReactDOM from "react-dom/client";

console.log(this);

class Hello extends React.Component {
  render() {
    console.log(this.props);
    return (
      <div>
        <button onClick={this.fn1}>点我</button>
      </div>
    );
  }
}

class App extends React.Component {
  render() {
    return <Hello onClick={this.fn1} />;
  }

  fn1() {
    console.log("fn1", this);
  }
}

const root = ReactDOM.createRoot(document.querySelector("#root"));
root.render(<App />);
